<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <a href="<?php echo $this->url('cms-class', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加文章分类'); ?></a>
            <?php echo $this->HelpUrl('cmsClass'); ?>
        </h1>

    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box shop-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th><?php echo $this->translate('文章分类名称（分类ID）'); ?></th>
                                <th><?php echo $this->translate('文章数量'); ?></th>
                                <th><?php echo $this->translate('排序'); ?></th>
                                <th><?php echo $this->translate('状态'); ?></th>
                                <th width="18%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($this->classList) foreach ($this->classList as $classValue) { ?>
                                <tr>
                                    <td><?php echo ($classValue->getCmsClassTopId() > 0 ? str_repeat('&nbsp;', 3) . '|----' : '') . $this->escapeHtml($classValue->getCmsClassName()).'（ID：'.$classValue->getCmsClassId().'）'; ?></td>
                                    <td><?php echo $this->cmsNumArray[$classValue->getCmsClassId()]; ?></td>
                                    <td><?php echo $classValue->getCmsClassSort(); ?></td>
                                    <td><?php echo $this->cmsHelper()->cmsClassState($classValue->getCmsClassState()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('cms-class',
                                            ['action'=>'edit', 'id'=>$classValue->getCmsClassId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>
                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该文章分类吗?'); ?>', '<?php echo $this->url('cms-class', ['action'=>'delete', 'id'=>$classValue->getCmsClassId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                        <a href="<?php echo $this->url('shop-cms', ['id' => $classValue->getCmsClassId()]); ?>" target="_blank" class="btn btn-xs btn-info"><i class="fa fa-share"></i> <?php echo $this->translate('预览'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>

                </div>

            </div>
        </div>

    </section>
</div>